Skip to main content link. Accesskey S
  • Help
  • HCL Logo
  • HCL Notes and Domino Application Development wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
Community Articles > Troubleshooting > @DBLookup
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

@DBLookup

I am having extreme difficulty with @DBLookup and am looking for solutions.
Community article@DBLookup
Added by IBM contributor~Tate Relupulakol | Edited by ~Pippy Asaacheklen on September 26, 2016 | Version 3
  • Actions Show Menu▼
expanded Abstract
collapsed Abstract
I am having extreme difficulty with @DBLookup and am looking for solutions.
Tags: @DBLookup, datatype, @DBColumn

Hello,

I am having a great deal of difficulty getting an @DBLookup formula to work in an Input form in a databse which I will refer to here as the source database.. The formula is:

@DbLookup ("" : "NoCache" ; "" : Mammals_SR_Courses.nsf; "PetInfo" ; DBCPetsList; 2; "")

Petinfo is a two-column view in a different database, which I refer to as the target database. The two columns and associated data are:

Pets          Petfood

Birds        Seeds

Cats         Tuna

Dogs        Kibble

Fish          Flakes

The source database has a shared field called DBCPetsList. This shared field is an editable dialog list field. It uses @DBColumn to call the PetInfo View in the target database and allow the user to select one of the pets in the Pets column. This is working fine, and the user can select one of the pets in the generated list. The @DBColumn Choices formula used in DBCPetsLIst is:

@DbColumn("":"";"":"Mammals_SR_Courses.nsf";"PetInfo";1)

Also in the source database is a shared field called DBLPetfood. DBLPetfood contains the @DBLookup formula shown above:

@DbLookup ("" : "NoCache" ; "" : Mammals_SR_Courses.nsf; "PetInfo" ; DBCPetsList; 2; "").

I have placed the @DBLookup formula in the Input Validation object of the shared field. I read that I was supposed to do that in the Domino help pages. Then, when I press F9 to refresh the page, I want to see an entry from the Petfood shared field from the target database. In other words, if the user selects "Birds" from the DBCPetsList field, pressing F9 should make "Seeds" appear in the DBLPetfood field. Instead,  I get the following message: "Incorrect datatype for database function".

I have tried all kinds of troubleshooting methods to figure out what is going on, but I have had no luck. I made sure that all fields are text fields, all are editable, all are non-multi value. I've tried using both column number and field name in the formula, and nothing different happens.

I found a way to test my code and make sure the data is right. I created a button that has the following formula:

@Prompt([Ok]; "Lookup key";
@If(@IsError(DBCPetsList); "ERROR: " + @Text(DBCPetsList);
@IsText(DBCPetsList); "\"" + @Implode(DBCPetsList; "\": \"") + "\"";
@Implode(@Text(DBCPetsList); ", ")
)
);
result := @DbLookup ("" : "NoCache" ; "" : Marquesas_SR_Courses.nsf; "PetInfo" ; DBCPetsList; 2; "");

If I choose "Birds" in DBCPetsList, this test button returns "Birds." So I think that means it's working okay.

I learned that I can paste my code in a text field and press Shift F9. When I paste in my @DBLookup formula, I get this: ERROR: A view of that name cannot be found in the specified database

I've verified that I have the right View Name: PetInfo. The other field in the source database has no trouble accessing the view. I thought maybe I had the wrong column #, but that is not the case, and as I wrote earlier, it does not work using field name, either. I'm out of troubleshooting ideas. I would be really grateful if someone would look at my rpblem and offer some solutions. Thanks!t


  • Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (3)
collapsed Versions (3)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (3)Sep 26, 2016, 6:37:15 AM~Pippy Asaacheklen  
2Apr 4, 2016, 2:24:44 PM~Nita Feznitexader  Minor change
1Oct 11, 2012, 7:43:58 PM~Jennifer Ophipivitchakol  IBM contributor
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL
  • Privacy
  • Accessibility